package com.chaoyer.cynet.common.exception;

import io.netty.handler.codec.http.HttpHeaders;

/*
*  404异常
* */
public class NoHandlerFoundException extends RuntimeException {

    private final String httpMethod;

    private final String requestURL;

    private final HttpHeaders headers;


    /**
     * Constructor for NoHandlerFoundException.
     *
     * @param httpMethod the HTTP method
     * @param requestURL the HTTP request URL
     * @param headers    the HTTP request headers
     */
    public NoHandlerFoundException(String httpMethod, String requestURL, HttpHeaders headers) {
        super("No handler found for " + httpMethod + " " + requestURL);
        this.httpMethod = httpMethod;
        this.requestURL = requestURL;
        this.headers = headers;
    }


    public String getHttpMethod() {
        return this.httpMethod;
    }

    public String getRequestURL() {
        return this.requestURL;
    }

    public HttpHeaders getHeaders() {
        return this.headers;
    }

}